//package com.program.facesigninsystem.config;
//
//import com.fasterxml.jackson.databind.DeserializationFeature;
//import com.fasterxml.jackson.databind.ObjectMapper;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
//import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
//import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
//
//import java.text.SimpleDateFormat;
//
//@Configuration
////public class WebConfig extends WebMvcConfigurationSupport{
//public class WebConfig implements WebMvcConfigurer {
//    @Override
//    public void addInterceptors(InterceptorRegistry registry) {
//        registry.addInterceptor(new ReqInterceptor()).addPathPatterns("/**")
//                .excludePathPatterns(
//                        "/auth/login",
//                        "/auth/adminLogin",
//                        "/auth/active",
//                        "/auth/getTabBar",
//                        "/rec/excel",
//                        "/auth/sendSms",
//                        "/auth/loginWeb",
//                        "/auth/showHelp",
//                        "/auth/getLoginCode",
//                        "/swagger-ui.html",
//                        "/swagger/**",
//                        "/swagger-resources/**",
//                        "/webjars/**",
//                        "/v2/**",
//                        "/swagger-ui.html/**");
//    }
//
////    @Override
////    public void addResourceHandlers(ResourceHandlerRegistry registry) {
////
////        // 解决静态资源无法访问
////        registry.addResourceHandler("/**").addResourceLocations("classpath:/static/");
////        // 解决swagger无法访问
////        registry.addResourceHandler("/swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/");
////        // 解决swagger的js文件无法访问
////        registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
////    }
//
//    @Bean
//    public MappingJackson2HttpMessageConverter jackson2HttpMessageConverter() {
//        MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
//        ObjectMapper mapper = new ObjectMapper();
//        mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
//        mapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
//        converter.setObjectMapper(mapper);
//        return converter;
//    }
//}
